<page-header></page-header>
<nz-card>
  <sf #cltjSF
    mode="search"
    [schema]="cltjSchema"
    [button]="null"
    autocomplete=false;
  >
  <ng-template sf-template='/DAD017'>
    <nz-select
    [(ngModel)]="qSelectOpt"
    nzShowSearch
    nzAllowClear
    [nzServerSearch]="true"
    (nzOnSearch)="qonSearch($event)"
  >
    <nz-option *ngFor="let o of qAD04List" [nzValue]="o.DAD017" [nzLabel]="o.LABEL"></nz-option>
    <nz-option *ngIf="qdisplayTips" nzDisabled nzCustomContent>
      请输入字符查询
    </nz-option>
  </nz-select>
  </ng-template>
  </sf>  
  <div nz-row>
    <div nz-col nzSpan="12" style="padding-left: 5px;padding-bottom: 5px;"><button (click)="cltjAdd()" nz-button nzType="primary"><i nz-icon nzType="plus"></i>材料条件新增</button></div>
    <div nz-col nzSpan="12" style="text-align: right;padding-right: 5px;padding-bottom: 5px;">
      <button (click)="cltjQuery()" nz-button nzType="primary"><i nz-icon nzType="search"></i>检索</button>
      <button (click)="this.cltjSF.reset()" nz-button nzType="default"><i nz-icon nzType="reload" nzTheme="outline"></i>重置</button>
    </div>
  </div>

  <div>
  <nz-list [nzDataSource]="listDataset" [nzRenderItem]="item" [nzGrid]="{ gutter: 16, span: 6 }">
    <ng-template #item let-item>
      <nz-list-item class="list_item" [nzContent]="nzContent">
        <ng-template #nzContent>
            <nz-card class="list_item_card"  [nzTitle]="item.DAA002" [nzExtra]="extraTemplate"  [nzActions]="[aa1,aa2]">
              <div *ngIf="item.tjList!==undefined && item.tjList.length<=4">
                <div *ngIf="item.tjList[0]!==undefined" class="text_hidden">1、{{item.tjList[0].tjName}}</div>
                <div *ngIf="item.tjList[0]===undefined" class="text_hidden">&nbsp;</div>
                <div *ngIf="item.tjList[1]!==undefined" class="text_hidden">2、{{item.tjList[1].tjName}}</div>
                <div *ngIf="item.tjList[1]===undefined" class="text_hidden">&nbsp;</div>
                <div *ngIf="item.tjList[2]!==undefined" class="text_hidden">3、{{item.tjList[2].tjName}}</div>
                <div *ngIf="item.tjList[2]===undefined" class="text_hidden">&nbsp;</div>
                <div *ngIf="item.tjList[3]!==undefined" class="text_hidden">4、{{item.tjList[3].tjName}}</div>
                <div *ngIf="item.tjList[3]===undefined" class="text_hidden">&nbsp;</div>
              </div>
              <div *ngIf=" item.tjList!==undefined && item.tjList.length>4">
                <div *ngIf="item.tjList[0]!==undefined" class="text_hidden">1、{{item.tjList[0].tjName}}</div>
                <div *ngIf="item.tjList[1]!==undefined" class="text_hidden">2、{{item.tjList[1].tjName}}</div>
                <div *ngIf="item.tjList[2]!==undefined" class="text_hidden">3、{{item.tjList[2].tjName}}</div>
                <div class="text_hidden">...</div>
              </div>
          </nz-card>
        </ng-template>
        <ng-template #extraTemplate>
          <a href="javascript:void(0);" (click)="show(item)">详情</a>
        </ng-template>
        <ng-template #aa1>
          <div nz-popconfirm
          nzPopconfirmTitle="确定删除该条件?"
          nzPopconfirmPlacement="top"
          (nzOnConfirm)="cltjDelete(item)"
            >
            <i nz-icon nzType="delete"></i>删除
          </div> 
        </ng-template>
        <ng-template #aa2>
         <div  (click)=" cltjUpdate(item)"><i nz-icon nzType="edit"></i>修改</div> 
        </ng-template>
      </nz-list-item>
    </ng-template>
  </nz-list>
</div>
<nz-pagination class="page_tool" nzPageSize="6" [nzPageIndex]="listPage.pageIndex" [nzTotal]="listPage.pageTotal" (nzPageIndexChange)="pageChange($event)"></nz-pagination> 
</nz-card>

<nz-modal [(nzVisible)]="cltjAddVisible" nzTitle="添加材料条件" (nzOnCancel)="cltjAddCancel()" (nzOnOk)="cltjAddOk()" nzWidth="400">
    <sf  #cltjAddSF [schema]="cltjAddSchema" [button]="null" nzOkText="保存"  autocomplete="off">
      <ng-template sf-template='/DAD017'>
        <nz-select
        [(ngModel)]="selectOpt"
        nzShowSearch
        [nzServerSearch]="true"
        (nzOnSearch)="onSearch($event)"
      >
        <nz-option *ngFor="let o of AD04List" [nzValue]="o.DAD017" [nzLabel]="o.LABEL"></nz-option>
        <nz-option *ngIf="displayTips" nzDisabled nzCustomContent>
          请输入字符查询
        </nz-option>
      </nz-select>
      </ng-template>
    </sf>
</nz-modal> 

<nz-modal [(nzVisible)]="cltjUpVisible" nzTitle="材料条件修改" (nzOnCancel)="cltjUpCancel()" (nzOnOk)="cltjUpOk()" nzWidth="400">
  <sf  #cltjUpSF [schema]="cltjUpSchema"  [button]="null" nzOkText="保存"  autocomplete="off">
    <ng-template sf-template='/DAD017'>
      <nz-select
      [(ngModel)]="uSelectOpt"
      nzShowSearch
      [nzServerSearch]="true"
      (nzOnSearch)="uonSearch($event,false)"
    >
      <nz-option *ngFor="let o of uAD04List" [nzValue]="o.DAD017" [nzLabel]="o.LABEL"></nz-option>
      <nz-option *ngIf="udisplayTips" nzDisabled nzCustomContent>
        请输入字符查询
      </nz-option>
    </nz-select>
    </ng-template>
  </sf>
</nz-modal> 

<nz-modal [(nzVisible)]="cltjShowVisible" nzTitle="材料条件详情" (nzOnCancel)="cltjShowCancel()" [nzFooter]="null" nzWidth="400">
  <sv-container class="showWord" col="1" *ngIf="showItem!==undefined" labelWidth="100">
    <sv class="showWord" label="标签ID" >{{showItem.DAC004}}</sv>
    <sv class="showWord" label="事项名称">{{showItem.DAD017_S}}</sv>
    <sv class="showWord" label="条件类别">{{showItem.DAA002}}</sv>
    <sv class="showWord" label="条件字段" nz-row>
      <div class="showWord" nz-col nzSpan="24" *ngFor="let o of showItem.tjList;let i=index">{{i+1}}、{{o.tjName}}</div>
    </sv>
    <div>&nbsp;</div>
    <div>&nbsp;</div>
    <div>&nbsp;</div>
  </sv-container>
</nz-modal>